<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">
<f:metadata>
	<f:event listener="#{pendingTransactionManageBean.onLoad}"
		type="preRenderView"></f:event>
</f:metadata>
<h:body>
	<ui:composition template="/Group2/masterPage.xhtml">
		<ui:define name="content">
			<!-- start content -->
			<div id="content">

				<!--  start page-heading -->
				<div id="page-heading"></div>
				<!-- end page-heading -->

				<table border="0" width="100%" cellpadding="0" cellspacing="0"
					id="content-table">
					<tr>
						<th rowspan="3" class="sized"><h:graphicImage
								library="group2" name="images/shared/side_shadowleft.jpg"
								width="20" height="300" alt="" /></th>
						<th class="topleft"></th>
						<td id="tbl-border-top">&nbsp;</td>
						<th class="topright"></th>
						<th rowspan="3" class="sized"><h:graphicImage
								library="group2" name="images/shared/side_shadowright.jpg"
								width="20" height="300" alt="" /></th>
					</tr>
					<tr>
						<td id="tbl-border-left"></td>
						<td>
							<!--  start content-table-inner ...................................................................... START -->
							<div id="content-table-inner">

								<!--  start table-content  -->
								<div id="table-content">
									<!--  start product-table ..................................................................................... -->

									<p:panel id="panel1" header="SENDER DETAIL"
										rendered="#{pendingTransactionManageBean.senderCustomer ne null}"
										style="margin-bottom:10px;">
										<h:panelGrid columns="2">
											<p:outputLabel value="Customer ID:" for="senderCusID" />
											<p:inputText readonly="true" id="senderCusID"
												value="#{pendingTransactionManageBean.senderCustomer.customerID}">
												<f:convertNumber />
											</p:inputText>
											<p:outputLabel value="IDCardNumber:" for="senderIDCardNumber" />
											<p:inputText readonly="true" id="senderIDCardNumber"
												value="#{pendingTransactionManageBean.senderCustomer.idCardNumber}">
												<f:convertNumber />
											</p:inputText>
											<p:outputLabel value="Balance:" for="senderBalance" />
											<p:inputText readonly="true" id="senderBalance"
												value="#{pendingTransactionManageBean.sender.accountBalance}">
												<f:convertNumber pattern="#,###,##0.00" />
											</p:inputText>
											<p:outputLabel value="First Name:" for="senderFirstName" />
											<p:inputText id="senderFirstName"
												value="#{pendingTransactionManageBean.senderCustomer.firstName}"
												readonly="true" />
											<p:outputLabel value="Last Name:" for="senderLastName" />
											<p:inputText id="senderLastName"
												value="#{pendingTransactionManageBean.senderCustomer.lastName}"
												readonly="true" />
										</h:panelGrid>
									</p:panel>

									<p:panel id="panel2" header="RECEIVER DETAIL"
										rendered="#{pendingTransactionManageBean.receiverCustomer ne null}"
										style="margin-bottom:10px;">
										<h:panelGrid columns="2">
											<p:outputLabel value="Customer ID:" for="receiverCusID" />
											<p:inputText readonly="true" id="receiverCusID"
												value="#{pendingTransactionManageBean.receiverCustomer.customerID}">
												<f:convertNumber />
											</p:inputText>
											<p:outputLabel value="IDCardNumber:"
												for="ReceiverIDCardNumber" />
											<p:inputText readonly="true" id="ReceiverIDCardNumber"
												value="#{pendingTransactionManageBean.receiverCustomer.idCardNumber}">
												<f:convertNumber />
											</p:inputText>
											<p:outputLabel value="Balance:" for="receiverBalance" />
											<p:inputText readonly="true" id="receiverBalance"
												value="#{pendingTransactionManageBean.receiver.accountBalance}">
												<f:convertNumber pattern="#,###,##0.00" />
											</p:inputText>
											<p:outputLabel value="First Name:" for="receiverFirstName" />
											<p:inputText id="receiverFirstName"
												value="#{pendingTransactionManageBean.receiverCustomer.firstName}"
												readonly="true" />
											<p:outputLabel value="Last Name:" for="receiverLastName" />
											<p:inputText id="receiverLastName"
												value="#{pendingTransactionManageBean.receiverCustomer.lastName}"
												readonly="true" />
										</h:panelGrid>
									</p:panel>
									<br />
									<p:panel id="panel9" header="TRANSACTION DETAIL" />
									<h:dataTable
										rendered="#{pendingTransactionManageBean.transactionSelected ne null}"
										value="#{pendingTransactionManageBean.transactionSelected}"
										var="l" id="product-table" border="0" width="100%"
										cellpadding="0" cellspacing="0"
										headerClass="table-header-repeat line-left">

										<h:column>
											<!-- column header -->
											<f:facet name="header">
													Transaction ID
												</f:facet>
											<!-- row record -->
											<h:outputText value="#{l.transactionID}">
												<f:convertNumber />
											</h:outputText>
										</h:column>
										<h:column>
											<f:facet name="header">Deposit Account Number</f:facet>
											<h:outputText value="#{l.depositAccountNumber}">
												<f:convertNumber />
											</h:outputText>
										</h:column>
										<h:column>
											<f:facet name="header">Type</f:facet>
											<h:outputText value="#{l.transactionType}" />
										</h:column>
										<h:column>
											<f:facet name="header">State</f:facet>
											<h:outputText value="#{l.transactionState}" />
										</h:column>
										<h:column>
											<f:facet name="header">Funds</f:facet>
											<h:outputText value="#{l.funds}">
												<f:convertNumber pattern="#,###,##0.00" />
											</h:outputText>
										</h:column>

										<h:column>
											<f:facet name="header">Begin Time</f:facet>
											<h:outputText value="#{l.beginTime}">
												<f:convertDateTime pattern="dd/MM/yyyy hh:mm:ss" />
											</h:outputText>
										</h:column>

										<!-- <h:column>
											<f:facet name="header">End Time</f:facet>
											<h:outputText value="#{l.endTime}">
												<f:convertDateTime pattern="dd/MM/yyyy hh:mm:ss" />
											</h:outputText>
										</h:column>  -->

										<h:column>
											<f:facet name="header">Internet Transaction</f:facet>
											<h:outputText value="#{l.internetTransaction}" />
										</h:column>
										<h:column>
											<f:facet name="header">Creator</f:facet>
											<h:outputText value="#{l.createdBy}">
												<f:convertNumber />
											</h:outputText>
										</h:column>
										<h:column>
											<f:facet name="header">Approver</f:facet>
											<h:outputText value="#{l.approvedBy}">
												<f:convertNumber />
											</h:outputText>
										</h:column>
										<h:column>
											<f:facet name="header">Content</f:facet>
											<h:outputText value="#{l.content}" />
										</h:column>
										<h:column>
											<f:facet name="header">Options</f:facet>
											<h:form>
												<h:panelGrid columns="2">
													<h:commandButton styleClass="myButton"
														action="#{pendingTransactionManageBean.approveDepositTransaction(l.transactionID)}"
														value="Approve" />
													<h:commandButton styleClass="myButton"
														action="#{pendingTransactionManageBean.denyDepositTransaction(l.transactionID)}"
														value="  Deny  " />
												</h:panelGrid>
											</h:form>
										</h:column>
									</h:dataTable>
									<!--  end product-table................................... -->

								</div>
								<!--  end content-table  -->
								<div class="clear"></div>

							</div> <!--  end content-table-inner ............................................END  -->
						</td>
						<td id="tbl-border-right"></td>
					</tr>
					<tr>
						<th class="sized bottomleft"></th>
						<td id="tbl-border-bottom">&nbsp;</td>
						<th class="sized bottomright"></th>
					</tr>
				</table>
				<div class="clear">&nbsp;</div>

			</div>
			<!--  end content -->
			<div class="clear">&nbsp;</div>
		</ui:define>
	</ui:composition>

</h:body>
</html>
